<extend name="public@base5"/>
<block name="main">
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
            <li class="nav-item">
                <a class="nav-link active" href="javascript:" data-bs-target="#A" data-bs-toggle="tab">
                    店铺资料
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="javascript:" data-bs-target="#B" data-bs-toggle="tab">
                    营业执照
                </a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="javascript:" data-bs-target="#C" data-bs-toggle="tab">
                    账户资料
                </a>
            </li>
        </ul>
        <form class="form-horizontal js-ajax-form margin-top-20" role="form" action="admin/shop_apply/detail" method="PUT">
            <div class="tabbable">
                <div class="tab-content">
                    <div class="tab-pane active" id="A">
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">店铺名称</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.name}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">店铺简称</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.abb_name}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">行业类型</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.category.title}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">法人手机</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.faren_mobile}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">联系人手机</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.contacts_mobile}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">邮箱</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.email}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">法人身份证照片</label>
                            <div class="col-md-8 col-sm-10">
                                <foreach name="row.id_card_front_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                                <foreach name="row.id_card_back_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">法人姓名</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.faren_name}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">法人身份证</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.id_card}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">身份证有效期开始</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.id_card_start_date}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">身份证有效期结束</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.id_card_end_date}" readonly>
                            </div>
                        </div>
                        <!-- <div class="row mb-3">
                            <div class="offset-md-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit" data-refresh="0">
                                    <i class="fa fa-save fa-fw"></i> {:lang('SAVE')}
                                </button>
                            </div>
                        </div> -->
                    </div>
                    <div class="tab-pane" id="B">
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">营业许可证</label>
                            <div class="col-md-8 col-sm-10">
                                <foreach name="row.business_license_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">营业执照名称</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.business_license_name}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">社会统一信用代码</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.business_license_code}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">商用有效期开始</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.business_license_start_date}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">企业地址</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.address}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">所在区域</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.province.areaname}{$row.city.areaname}{$row.district.areaname}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">门头照</label>
                            <div class="col-md-8 col-sm-10">
                                <foreach name="row.shop_out_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">内景照</label>
                            <div class="col-md-8 col-sm-10">
                                <foreach name="row.shop_in_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                            </div>
                        </div>
                        <!-- <div class="row mb-3">
                            <div class="offset-md-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit" data-refresh="0">
                                    <i class="fa fa-save fa-fw"></i> {:lang('SAVE')}
                                </button>
                            </div>
                        </div> -->
                    </div>
                    <div class="tab-pane" id="C">
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">结算账户类型</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_type}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">银行卡照片</label>
                            <div class="col-md-8 col-sm-10">
                                <foreach name="row.bank_front_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                                <foreach name="row.ban_back_image" item="v">
                                <img src="{$v|cmf_get_image_url}" width="200">
                                </foreach>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">开户名</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_username}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">账户号码</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_no}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">开户行</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_name}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">银行所在地</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_address}" readonly>
                            </div>
                        </div>
                        <div class="row mb-3">
                            <label for="input-site_seo_title" class="col-sm-2 col-form-label text-sm-end">预留手机号</label>
                            <div class="col-md-8 col-sm-10">
                                <input type="text" class="form-control" value="{$row.bank_mobile}" readonly>
                            </div>
                        </div>
                        <!-- <div class="row mb-3">
                            <div class="offset-md-2 col-sm-10">
                                <button type="submit" class="btn btn-primary js-ajax-submit" data-refresh="0">
                                    <i class="fa fa-save fa-fw"></i> {:lang('SAVE')}
                                </button>
                            </div>
                        </div> -->
                    </div>
                    <div class="row mb-3">
                        <if $row.status == 0>
                            <div class="offset-md-2 col-sm-10">
                                <button type="button" class="btn btn-primary pass" data-refresh="0">
                                    通过
                                </button>
                                <button type="button" class="btn btn-primary nopass" data-refresh="0">
                                    驳回
                                </button>
                            </div>
                        </if>
                    </div>
                </div>
            </div>
        </form>
    </div>
<script src="/static/js/admin.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script type="text/javascript">
    var id = {:input('id')};


    $('.pass').click(function(){
        layer.confirm('确认通过审核?', {icon: 3, title:'提示'}, function(index){
            $.ajax({
                type: 'post',
                url: '{:url("shop_apply/examine")}',
                data: {id:id,act:'yes'},
                success:function(res){
                    layer.msg(res.msg);
                    location.reload();
                }
            });
        });
    });

    $('.nopass').click(function(){
        layer.prompt({
            formType: 2,
            title: '请输入驳回原因',
        }, function(value, index, elem){
            layer.close(index);
            $.ajax({
                type: 'post',
                url: '{:url("shop_apply/examine")}',
                data: {id:id,act:'no',remark:value},
                success:function(res){
                    layer.msg(res.msg);
                    location.reload();
                }
            });
        });
    });

    
</script>
</block>